﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class admin_qljobs : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void addbt_Click(object sender, EventArgs e)
    {

    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {

    }
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {

    }
    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {

    }
    protected void addbt_Click1(object sender, EventArgs e)
    {
        Int64 id = Common.createID();
        hdfID.Value = id.ToString();
        SqlDataSource1.Insert();
        SqlDataSource1.DataBind();
        this.des.Text = "";
    }
    private void insertJob(Int32 JobID, Int64 JobLangID, String des, String title, String menu_vn, String menu_en, String content_vn, String content_en)
    {
        connection connect = new connection();
        SqlConnection conn = connect.connect();
        String sql = "insert into Jobs(id, [description]) values(@id, @description);insert into Jobs_lang(id, lang, title, menu,content) values(@lang_id, @lang, @title,@menu,@content) ";
        SqlCommand cmd = new SqlCommand();
        cmd.CommandText = sql;
        cmd.Connection = conn;

        /*
        cmd.Parameters.AddWithValue("check", check);
        cmd.Parameters.AddWithValue("id", id);
        cmd.ExecuteNonQuery();
         */ 
    }
    protected void SqlDataSource1_Inserted(object sender, SqlDataSourceStatusEventArgs e)
    {
        
        Response.Write("<script>alert('Thêm Thành Công');</script");
    }
}